<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../share/taglib.jsp" %>
<html>
<head>
<title>评论回复</title>
<base target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/vip.css" type="text/css">
<%@ include file="/sks/cms/page/share/validate.inc" %>
<script language="JavaScript">
//到指定的分页页面
function topage(page){
	var form = document.forms[0];
	form.page.value = page;
	form.submit();
}
function checkAllRevert(obj) {
	var cs = document.getElementsByName("revertIds");
	for (var i = 0; i < cs.length; i++) {
		cs[i].checked = obj.checked;
	}
}
function deleteReverts(url, needConfirm) {
	var cs = document.getElementsByName("revertIds");
	var checkNo = 0;
	for (var i = 0; i < cs.length; i++) {
		if(cs[i].checked) {
			checkNo++;
		}
	}
	if (checkNo == 0) {
		alert('尚未选中任何记录');
		return false;
	}
	
	if (needConfirm) {
		if(!confirm('确定要删除选中的评论吗？')) {
			return false;
		}
	}
	var form = document.getElementById('houseForm');
	form.action = url;
	form.method.value = 'deleteRevert';
	form.submit();
}
function bodyOnLoad() {
	//tt.Conf.errorStyle = 'alert';
	var f1 = new tt.Field("回复内容","","content").setMsgId("content_msgId");
	tt.vf.req.add(f1);
	new tt.LV().set(0, 500).add(f1);
}
function revert() {
	if (tt.validate()) {
		var form = document.forms[0];
		form.method.value = 'revert';
		form.submit();
	}
}
</script>
</head>
<body onload="bodyOnLoad();" bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0">
<html:form action="/cms/house/comment.do" method="post">
<html:hidden property="page"/>
<html:hidden property="commentId"/>
<html:hidden property="method" value="listRevert"/>
  <table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
	<tr>
  	  <td width="5%" height="1">&nbsp;</td>
      <td width="5%" height="1">&nbsp;</td>
      <td width="15%" height="1">&nbsp;</td>
      <td width="50%" height="1">&nbsp;</td>
      <td width="25%" height="1">&nbsp;</td>
  	</tr>
  	<tr>
  		<td colspan="3" valign="top" align="right">回复内容:</td>
  		<td colspan="2"><html:textarea property="content" cols="40" rows="7"/></td>
  	</tr>
  	<tr>
  		<td colspan="3">&nbsp;</td>
  		<td colspan="2"><div id="content_msgId"></div></td>
  	</tr>
  	<tr>
  		<td colspan="3">&nbsp;</td>
  		<td colspan="2" align="left"><button type="button" onclick="revert();">回复</button></td>
  	</tr>
  	<tr>
  		<td colspan="5" height="5"></td>
  	</tr>
    <tr><td colspan="5" bgcolor="#ffbe26" align="right">
    	<%@ include file="../share/fenye.jsp" %>
	</td></tr>
    <tr>
      <td bgcolor="#ffbe26"> <input type="checkbox" name="checkAll" onclick="checkAllRevert(this);"/></td>
      <td bgcolor="#ffbe26"> <div align="center"><font color="#000000">代号</font></div></td>
      <td bgcolor="#ffbe26"> <div align="center"><font color="#000000">内部员工</font></div></td>
      <td bgcolor="#ffbe26"> <div align="center"><font color="#000000">内容</font></div></td>
      <td bgcolor="#ffbe26"> <div align="center"><font color="#000000">回复时间</font></div></td>
    </tr>
<!---------------------------LOOP START------------------------------>
<c:forEach items="${pageView.records}" var="entry">
    <tr>
      <td bgcolor="f5f5f5"><input type="checkbox" name="revertIds" value="${entry.revertId}"/></td>
      <td bgcolor="f5f5f5"><div align="center">${entry.revertId}</div></td>
      <td bgcolor="f5f5f5"><div align="center">${entry.employee.username}</div></td>
      <td bgcolor="f5f5f5"><div align="center">${entry.content}</div></td>
      <td bgcolor="f5f5f5"><div align="center"><fmt:formatDate value="${entry.revertTime}" type="both"/></div></td>
	</tr>
</c:forEach>
<!----------------------LOOP END------------------------------->

	<tr>
      <td colspan="6" nowrap bgcolor="#ffbe26" align="left">
      	<table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="5%"></td>
              <td width="85%">
              <input type="button" <c:if test="${fn:length(pageView.records) == 0}">disabled="disabled"</c:if> onClick="javascript:deleteReverts('/cms/house/comment.do', true);" value="删除">&nbsp;&nbsp;
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</html:form>
</body>
</html>